﻿using CommandLine;
using CommandLine.Text;

namespace CreateVisualStudioMacros
{
    class CommandLineOptions
    {
        [Option('o', "outputfolder", Required = true, HelpText = "Output folder.")]
        public string OutputFolder { get; set; }

        [Option('v', "verbose", DefaultValue = true, HelpText = "Prints all messages to standard output.")]
        public bool Verbose { get; set; }

        [Option('u', "URL", Required = true, HelpText = "URL to CRM server. Example: http://crm2011/contoso")]
        public string CrmServerUrl { get; set; }

        [Option('n', "username", Required = false, HelpText = "User name")]
        public string UserName { get; set; }

        [Option('p', "password", Required = false, HelpText = "Password.")]
        public string Password { get; set; }

        [Option('d', "domain", Required = false, HelpText = "Domain name")]
        public string DomainName { get; set; }

        [Option('c', "connectiontype", Required = true, HelpText = "Connection Type: Testing=0, ActiveDirectory=1, ActiveDirectoryIntegrated=2, Online=3, OnlineOffice365=4")]
        public int ConnectionType { get; set; }

        [ParserState]
        public IParserState LastParserState { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this,
              current => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }

}
